package com.sdj.quick.web.controller;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.sdj.quick.web.dto.OpenSmsDto;

/***
 * 快捷绑卡短信测试
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/sms")
public class OpenSMSController extends BaseController{
	
	@RequestMapping("/toOpenSMS")
	public String toOpenSMS(){
		return "openSms";
	}
	
	@RequestMapping(value="/sendOpenSMS",method=RequestMethod.POST)
	public @ResponseBody String sendOpenSMS(OpenSmsDto openSmsDto){
		logger.info("快捷绑卡短信发送请求参数对象:【{}】",openSmsDto);
		String merKey = openSmsDto.getMerKey();
		String path = quickConfig.getOpenSMSUrl();
		openSmsDto.setMerchantOrderId(getOrderNo("400"));
		Map<String,String> map = getPostResult(path,merKey,openSmsDto);
		return JSON.toJSONString(map);
	}

}
